#include"com.hpp"

int main()
{
    //以只写方式打开
    int fd = open(namepipe_path, O_WRONLY);

    char buff[1024];
    memset(buff, 0, read_max);
    while (true)
    {
        //从stdin读取字符
        std::cout << "please say: " ;
        fgets(buff, write_max, stdin);
        int a = strlen(buff);
        buff[strlen(buff) - 1] = 0;//去除手动的回车符
        //写入管道
        write(fd, buff, write_max);
    }

    return 0;
}